var path = require('path')
var webpack = require('webpack')

module.exports = {
  entry: {
    build: path.join(__dirname, 'client/main.js'),
  },
  output: {
    path: path.resolve(__dirname, '/dist'),
    publicPath: '/dist/',
    filename: '[name].js'
  },
  module: {
    rules: [{
        test: /\.vue$/,
        use: ['vue-loader']
      }, {
      test: /\.js$/,
      use: {
        loader: "babel-loader",
        options: {
          compact: true
        }
      }
    }, {
      test: /\.pug$/,
      use: ['pug-loader']
    }, {
        test: /\.styl$/,
        use: ['style-loader', 'css-loader', 'stylus-loader']
      }, {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      }, {
        test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
        use: [{
          loader: 'url-loader',
          options: {
            limit: 10000
          }
        }]
      }]
  },
  plugins: [
    new webpack.optimize.CommonsChunkPlugin({
      names: ['vendor']
    })
  ],
  devtool: 'inline-source-map'
}
